package lambda;


import java.io.File;
import java.io.FileFilter;

public class Test {
    public static void main(String[] args) {
        File dir = new File(".");

        //匿名内部类
        FileFilter file = new FileFilter() {
            @Override
            public boolean accept(File pathname) {
                return pathname.getName().contains("o");
            }
        };

        File[] subs = dir.listFiles(f -> f.getName().contains("o"));
        for (File sub : subs) {
            System.out.println(sub.getName());
        }
    }
}
